---#module orm管理类
local _orm = class("ORM")
-- ==========================
--default params
local d = Ding
local Logger = d.Logger
-- ==========================

function _orm:ctor(smap)
    self._smap = smap
    self._rmap = {}
end

function _orm:get(keyname)
    if self._rmap[keyname] then return self._rmap[keyname] end 
    if not self._smap[keyname] then 
        Logger:error("create orm <%s> failed! not in orm mapping!", keyname)
        return 
    end
    local cfg = self._smap[keyname]
    local src_f = cfg["src"]
    local inc = require(src_f).new(cfg["dccfg"])
    return inc
end

return _orm